//
//  FKHomeSectionHeader.m
//  WanTao
//
//  Created by Macbook Pro on 2019/3/16.
//  Copyright © 2019 Macbook Pro. All rights reserved.
//

#import "FKHomeSectionHeader.h"

@interface FKHomeSectionHeader ()

@property (nonatomic, weak) UIImageView *iconView;

@end

@implementation FKHomeSectionHeader

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setupSubviews];
    }
    return self;
}

- (void)setupSubviews
{
    UIImageView *iconView = [[UIImageView alloc] init];
    [self addSubview:iconView];
    self.iconView = iconView;
    
    [iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.centerY.offset(0);
//        make.width.offset(fk_adjustW(180));
//        make.height.offset(fk_adjustW(30));
    }];
}

- (void)setData:(id)data
{
    _data = data;
    
    self.iconView.hidden = !data;
    if ([data isKindOfClass:[NSString class]]) {
        self.iconView.image = [UIImage imageNamed:data];
    }
}

@end
